package com.baor.controller;

import com.baor.domain.TeacherVo;
import com.baor.service.TeacherService;
import com.baor.utils.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping(value = "/teacher")
public class TeacherController {

    @Autowired
    private TeacherService teacherService;

    @RequestMapping("insertTeacher")
    public AjaxResult<?> insertTeacher(@RequestBody TeacherVo teacherVo){
        return this.teacherService.insertTeacher(teacherVo);
    }

    @RequestMapping("selectTeacher")
    public AjaxResult<?> selectTeacher(@RequestBody Map<String,Object> map){
        return this.teacherService.selectTeacher(map);
    }

    @RequestMapping("updateTeacher")
    public AjaxResult<?> updateTeacher(@RequestBody TeacherVo teacherVo){
        return this.teacherService.updateTeacher(teacherVo);
    }

    @RequestMapping("deleteTeacher")
    public AjaxResult<?> deleteTeacher(@RequestBody TeacherVo teacherId){
        return this.teacherService.deleteTeacher(teacherId);
    }

    @RequestMapping("teacherInfo")
    public AjaxResult<?> teacherInfo(@RequestBody Map<String,Object> teacherId){
        return this.teacherService.teacherInfo(teacherId);
    }

    @RequestMapping("clazzSelect")
    public AjaxResult<?> clazzSelect(){
        return this.teacherService.clazzSelect();
    }

    @RequestMapping("subjectSelect")
    AjaxResult<?> subjectSelect(){
        return this.teacherService.subjectSelect();
    }

    @RequestMapping("roleSelect")
    AjaxResult<?> roleSelect(){
        return this.teacherService.roleSelect();
    }
}
